﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StyleMVVM.Data;
#if !DOT_NET
using Windows.Foundation.Metadata;
#endif
#if NETFX_CORE
using Windows.UI.Xaml.Media;
#else
using System.Windows.Media;

#endif

namespace StyleMVVM.View
{
	/// <summary>
	/// Represents an object that can Navigate a frame within the app.
	/// At Runtime this just wraps a Frame class, at UnitTest Time this is 
	/// substituted for something else
	/// </summary>
	public interface INavigationService : INotifyPropertyChanged
	{
		/// <summary>
		/// Is the navigation service currently valid
		/// </summary>
		bool IsValid { get; }

		/// <summary>
		/// Can the service navigate back
		/// </summary>
		bool CanGoBack { get; }

		/// <summary>
		/// Can the service navigate forward
		/// </summary>
		bool CanGoForward { get; }

		/// <summary>
		/// Navigate Home if possible
		/// </summary>
		void GoHome();

		/// <summary>
		/// Navigate Back if possible
		/// </summary>
		void GoBack();

		/// <summary>
		/// Navigate forward if possible
		/// </summary>
		void GoForward();

#if !WINDOWS_PHONE
	/// <summary>
	/// Navigate to a new page by name
	/// </summary>
	/// <param name="pageName">name of the page (usually class name)</param>
	/// <param name="navigationParam">navigation parameter</param>
	/// <returns>true if it could navigate to said page</returns>
		[DefaultOverload]
		bool Navigate(string pageName);

		/// <summary>
		/// Navigate to a new page By Type
		/// </summary>
		/// <param name="pageType">new page type</param>
		/// <param name="navigationParam">navigation parameter</param>
		/// <returns>true if it could navigate to said page</returns>
		bool Navigate(Type pageType);

		/// <summary>
		/// Navigate to a new page by name
		/// </summary>
		/// <param name="pageName">name of the page (usually class name)</param>
		/// <param name="navigationParam">navigation parameter</param>
		/// <returns>true if it could navigate to said page</returns>
		[DefaultOverload]
		bool Navigate(string pageName, object navigationParam);

		/// <summary>
		/// Navigate to a new page By Type
		/// </summary>
		/// <param name="pageType">new page type</param>
		/// <param name="navigationParam">navigation parameter</param>
		/// <returns>true if it could navigate to said page</returns>
		bool Navigate(Type pageType, object navigationParam);
#else
		/// <summary>
		/// Navigate to a new page base on Uri (this is the only supported method in the Windows Phone Frame control)
		/// </summary>
		/// <param name="pageName"></param>
		/// <returns></returns>
		bool Navigate(Uri pageName);
#endif

		Brush OverlayBackground { get; set; }

		/// <summary>
		/// Is there an open overlay on this page
		/// </summary>
		bool OverlayOpen { get; }

		/// <summary>
		/// Open an overlay on a Page
		/// </summary>
		/// <param name="overlayName">export name of overlay</param>
		bool OpenOverlay(string overlayName);

		/// <summary>
		/// Open an overlay on a Page
		/// </summary>
		/// <param name="overlayName">export name of overlay</param>
		/// <param name="context"> </param>
		bool OpenOverlay(string overlayName, object context);

		/// <summary>
		/// Replace the current overlay with a new overlay
		/// </summary>
		/// <param name="newOverlayName"></param>
		/// <param name="context"> </param>
		bool ReplaceOverlay(string newOverlayName);

		/// <summary>
		/// Replace the current overlay with a new overlay
		/// </summary>
		/// <param name="newOverlayName"></param>
		/// <param name="context"> </param>
		bool ReplaceOverlay(string newOverlayName, object context);

		/// <summary>
		/// Close the current overlay
		/// </summary>
		bool CloseOverlay();
	}
}